-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HTML5] Optional GDNative Support #44076
Conversation
f235ae8
to
e8f1a94
Compare
Firefox, but the latest version of chrome should also work. |
@@ -109,6 +110,7 @@ const GodotRTCDataChannel = { | |||
} | |||
}, | |||
|
|||
godot_js_rtc_datachannel_send__sig: 'iiiii', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's actually v
in Roman numerals ;)
EXPORT_MODE_GDNATIVE = 2, | ||
}; | ||
|
||
String _get_template_name(ExportMode p_mode, bool p_debug) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll get started on updating my build scripts to build all those flavours :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though for the 3.2
branch it's going to be a bit tricky as the current Mono version goes with Emscripten 1.39.7 (patched to 1.39.9 because 1.39.7 is broken), which doesn't work for GDNative.
We could possibly make the standard builds with Emscripten 2.0.10+ (normal, threads, gdnative) and Mono builds with Emscripten 1.39.9 (normal, threads). Or work our way through upstream Mono patches to up support to Emscripten 2.0.10 in the Mono 6.12 branch.
Looks great on a first review 👍 |
@DarkMessiah thanks for the report, I fixed the Chrome issue and uploaded a new version. |
Working with emscripten >= 2.0.10
This "breaks" our loading bar logic (libraries are not counted). Fixing it is non trivial and probably deserves investigating a different strategy.
Available types: - Regular - GDNative (support dynamic linking and thus GDNative WASM files) - Threads (uses WebAssembly Threads)
21a42eb
to
1fa97d7
Compare
This is suboptimal as it requires adding an extra compile flag, but rewriting how feature tags work is beyond the scope of this work.
1fa97d7
to
dd9503d
Compare
Emscripten 2.0.10 is out, I removed the ENet patch, and renamed the feature tag |
Exciting! |
Thanks! |
Should we add a version check in |
I'll look into that |
After months of works, refactoring, bloody tears, GDNative is finally working for HTML5 exports, with some quirks (see below).
Here is a working GDNative C++ demo running on the web.
The demo was built with this godot-cpp, this demo projects and this 3.2 branch. I'll PR them in the respective repositories.
Building a version that support dynamic linking requires a very recent emscripten version, at the time of writing
2.0.10
has been tested.You can build an HTML5 template with GDNative support via:
(yes, this kinda clash with
module_gdnative_enabled=yes
, should I rename it todlopen_enabled
?dynamic_linking_enabled
?)In this PR:
ENet patch to workaround emscripten 2.0.9 issue.Removed, no longer needed(now fixed upstream, new version will hopefully be good, once released I'll remove this commit and the draft status).Expected template names are:
webassembly[_$FEATURE]_$TARGET].zip
, e.gwebassembly_gdnative_release.zip
.When using custom export that option is only relevant for the GDNative build (otherwise the libraries won't be exported, but of course the selected template must be of the proper type).